home *** CD-ROM | disk | FTP | other *** search
Text File | 1987-08-29 | 4.6 KB | 125 lines | [TEXT/PJMM] |
- {seer_interface.p - interface file for using the 'seer' code resource}
- { to read AppleTalk packets permisciously }
- UNIT seer_interface;
- INTERFACE
- CONST
- PAK_SIZE = 610; {maximum suported packet size}
- SEER_MAJOR = 2; {major_version we where built with}
- SEER_MINOR = 1; {minor_version we where built with}
-
- TYPE
-
- { seer status structure.}
- { A pointer to this is returned by the SRr_load call.}
- { Following these defined fields are seers private data.}
- { These may be accessed for debugging purposes by examining}
- { seer_private.h for the format.}
- SR_status_ty = ( {seer status information}
- SR_status_off, {packet recording is off}
- SR_status_on, {packet recording is on}
- SR_status_dfull, {recording was on, but data queue filled up}
- SR_status_hfull); {recording was on, but header queue filled up}
- SR_status = RECORD
- status : SR_status_ty; {[out] current status}
- pre_pak_num : longint; {[out] packet number of packet before current}
- h_inuse : longint; {[out] number of header slots in use}
- h_size : longint; {[out] number of header slots}
- d_inuse : longint; {[out] number of data bytes in use}
- END;
- SR_status_pt = ^SR_status;
-
- {the argument block to a pointer to a routine}
- {Call the routine after loading}
- {and locking the 'seer' code resource. If it is ever unlocked}
- {then call SRa_load again.}
- SRa_load = RECORD
- major_version : integer; {[in]}
- minor_version : integer; {[out]}
- {******************************************************}
- { If there is a there is a major version mismatch and}
- { SRe_badver is returned, fields below here are unchanged.}
- {*****************************************************}
- status_pt : SR_status_pt; {[out] seer status}
- header_length : integer; {[out] bytes per packet header}
- data_overhead : integer; {[out] overhead per packet in data queue}
- END;
-
- {arguments for SRp_initq}
- SRa_initq = RECORD
- dbufstart : Ptr; {[in] start of data buffer}
- dbuflen : longint; {[in] length of data buffer}
- hbufstart : Ptr; {[in] start of header buffer}
- hbuflen : longint; {[in] length of header buffer}
- END;
-
- pak_err_ty = ( {the kinds of errors a packet can have}
- PE_none, {the packet didn't overrun, had an abort, good crc}
- PE_overrun, {the recieve data interupt routine missed some data}
- PE_noabort, {the packet did not end with an abort flag}
- PE_badcrc); {the packet had an incorrect hardware crc}
-
- {data passed to/from SRr_getpak}
- SRa_getpak = RECORD
- pak_num : longint; {[in] the number of the desired packet}
- pak_data : Ptr; {[out] a pointer to the packets data or NIL}
- pak_time : longint; {[out] when the packet came in (not yet implimented)}
- pak_err : pak_err_ty; {[out] what error occured on this packet}
- pak_size : integer; {[out] how big the packet is}
- END;
-
- { Note : opcode - 1 is used by the device manager to signal the goodbye kiss .}
- { We accept a goodbye kiss and turn off interupts and restore the interupt vectors}
- {if needed }
- SR_opcode_ty = ( {commands supported by seer}
- SRc_unused, {unused, reserved}
- SRc_killio, {killio does this control entry to stop io}
- SRc_load, {seer has just been loaded, bind absalute addresses}
- SRc_initq, {setup data and header queues}
- SRc_off, {stop collecting data}
- SRc_on, {start collecting data}
- SRc_getpak, {return a packet}
- SRc_release, {release the storage used by a packet}
- SRc_clear_queue); {empty the queue}
-
- SRe_error_ty = ( {seer error status return codes}
- SRe_noErr, {success, no error}
- SRe_badver, {the version of seer you said you wanted to SRr_load isn't available}
- SRe_never, {the packet number you asked SRr_getpak for has already been released}
- SRe_notyet); {the packet number you asked SRr_getpak for hasn't arrived yet}
-
- SR_record = RECORD
- SRe_error : SRe_error_ty;
- SR_user : longint;
- CASE SR_opcode_ty OF
- SRc_load : (
- a_load : SRa_load
- );
- SRc_initq : (
- a_initq : SRa_initq
- );
- SRc_off : (
- );
-
- SRc_on : (
- );
- SRc_getpak : (
- a_getpak : SRa_getpak
- );
- SRc_release : (
- );
- SRc_clear_queue : (
- );
- END;
- SR_record_pt = ^SR_record;
-
- {this representation works for c but I think it does not work for pascal,}
- {I have been using the Control call instead of PBControl so I don't know yet}
- SR_iorecord = RECORD
- io_cp : ParamBlockRec; {our operation is in csCode in here}
- io_SR : SR_record_pt; {may be longer than 22 bytes, point to control record}
- SR_dummy : ARRAY[0..8] OF integer; {pad up to the 22 bytes}
- END;
-
- IMPLEMENTATION
-
- END.